<template>
    <div>
初始化的值是：{{ obj.num }} <br>
<button @click="obj.num++">++</button>
    </div>
    <hr>
    <button @click="updateLocation">{{ location }}</button>
</template>

<script setup>
// defineProps(['num'])
import { inject } from 'vue'

const { location, updateLocation } = inject('location')
defineProps({obj:{default:0}})

</script>

<style  scoped>

</style>